﻿namespace FFF.Test.Application.AppServices.PublicService.Grid
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Threading.Tasks;

    /// <summary>
    /// easyUI的Grid接收参数
    /// </summary>
    public class GetGridListInDto
    {
        /// <summary>
        /// 导出文件的名称
        /// </summary>
        public string ExcelTitle { get; set; }

        /// <summary>
        /// 导出列的名称
        /// </summary>
        public string ColName { get; set; }

        /// <summary>
        /// 字段的名称
        /// </summary>
        public string FieldName { get; set; }

        /// <summary>
        /// 视图的名称
        /// </summary>
        [Required]
        public string ViewName { get; set; }

        /// <summary>
        /// 排序字段 
        /// </summary>
        public string Sort { get; set; }

        /// <summary>
        /// 排序（asc 和 desc）
        /// </summary>
        public string Order { get; set; }

        /// <summary>
        /// 过滤字符串
        /// </summary>
        public string Filter { get; set; }

        /// <summary>
        /// 第几页
        /// </summary>
        public string Page { get; set; }

        /// <summary>
        /// 每页多少行
        /// </summary>
        public string Rows { get; set; }

        /// <summary>
        /// 查询的列
        /// </summary>
        public string Select { get; set; }

        /// <summary>
        /// JUI的过滤条件
        /// </summary>
        public string FilterRules { get; set; }

        /// <summary>
        /// 高级过滤条件
        /// </summary>
        public string AdvanceFilter { get; set; }

        /// <summary>
        /// 是否禁用全局过滤
        /// </summary>
        /// <value>The is disable filter.</value>
        /// <remarks>ydm</remarks>
        public int IsDisableFilter { get; internal set; }
    }

    /// <summary>
    /// Jui的filter
    /// </summary>
    public class JuiFilterDto
    {
        /// <summary>
        /// 过滤的字段名称
        /// </summary>
        public string Field { get; set; }

        /// <summary>
        /// 操作
        /// </summary>
        public string Op { get; set; }

        /// <summary>
        /// 对应的值
        /// </summary>
        public string Value { get; set; }

        /// <summary>
        /// 对应的类型
        /// </summary>
        public string DataType { get; set; }
    }

    /// <summary>
    /// JUI高级过滤
    /// </summary>
    public class JUIAdvanceFilterDto
    {
        /// <summary>
        /// 关联条件 or 或者And
        /// </summary>
        public string Join { get; set; }

        /// <summary>
        /// 左边括号
        /// </summary>
        public string Lb { get; set; }

        /// <summary>
        /// 字段的名称
        /// </summary>
        public string Field { get; set; }

        /// <summary>
        /// 操作符
        /// </summary>
        public string Op { get; set; }

        /// <summary>
        /// 具体的值
        /// </summary>
        public string Value { get; set; }

        /// <summary>
        /// 右边括号
        /// </summary>
        public string Rb { get; set; }
    }

}
